 package com.lj.mcore.entity;

 import com.lj.mcore.domain.IdEntity;
 import jakarta.persistence.*;

 import java.util.ArrayList;
 import java.util.List;

 @Entity
 @Table(name="shopping_area")
 public class Area extends IdEntity
 {
   private String areaName;
 
   @OneToMany(mappedBy="parent", cascade={CascadeType.REMOVE})
   private List<Area> childs = new ArrayList();
 
   @ManyToOne(fetch= FetchType.LAZY)
   private Area parent;
   private int sequence;
   private int level;
 
   @Column(columnDefinition="bit default false")
   private boolean common;
 
   public boolean isCommon() { return this.common; }
 
   public void setCommon(boolean common)
   {
     this.common = common;
   }
 
   public List<Area> getChilds() {
     return this.childs;
   }
 
   public void setChilds(List<Area> childs) {
     this.childs = childs;
   }
 
   public Area getParent() {
     return this.parent;
   }
 
   public void setParent(Area parent) {
     this.parent = parent;
   }
 
   public String getAreaName() {
     return this.areaName;
   }
 
   public void setAreaName(String areaName) {
     this.areaName = areaName;
   }
 
   public int getLevel() {
     return this.level;
   }
 
   public void setLevel(int level) {
     this.level = level;
   }
 
   public int getSequence() {
     return this.sequence;
   }
 
   public void setSequence(int sequence) {
     this.sequence = sequence;
   }
 }



 
 